package lormi.meipin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lormi.meipin.dto.RegTalent;
import lormi.meipin.dto.TalentEditDto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class Talent implements Serializable{

	private static final long serialVersionUID = 1L;

	private Integer memid;

    private Byte level;

    private String name;

    private String photo;

    private Integer age;

    private Byte sex;
    
    private String sexname;

    private Byte workingage;

    private String currtitle;

    private Byte workingstate;
    
    private String workingstatename;

    private String label;

    private Date createtime;

    private Date updatetime;
    
    public Talent(Integer memid,RegTalent regTalent) {
		super();
		this.memid = memid;
		this.name = regTalent.getUsername();
		this.photo = regTalent.getPhone();
		this.age = regTalent.getAge();
		this.sex = regTalent.getSex();
		this.workingage = regTalent.getWorkingage();
		this.currtitle = regTalent.getCurrtitle();
		this.workingstate = regTalent.getWorkingstate();
		this.label = regTalent.getLabel();
		this.createtime = new Date();
		this.updatetime = this.createtime;
	}
    
    public Talent(TalentEditDto talentEditDto) {
		super();
		this.memid = talentEditDto.getUserid();
		this.name = talentEditDto.getUsername();
		this.photo = talentEditDto.getImgurl();
		this.age = talentEditDto.getAge();
		this.sex = talentEditDto.getSex();
		this.workingage = talentEditDto.getWorkingage();
		this.currtitle = talentEditDto.getCurrtitle();
		this.workingstate = talentEditDto.getWorkingstate();
		this.label = talentEditDto.getLabel();
		this.updatetime = new Date();
	}

	public Talent() {
		super();
	}


	private List<LabelTemplate> labels;

    public String getSexname() {
		return sexname;
	}

	public void setSexname(String sexname) {
		this.sexname = sexname;
	}

	public String getWorkingstatename() {
		return workingstatename;
	}

	public void setWorkingstatename(String workingstatename) {
		this.workingstatename = workingstatename;
	}

	public List<LabelTemplate> getLabels() {
		return labels;
	}

	public void setLabels(List<LabelTemplate> labels) {
		this.labels = labels;
	}

	public Integer getMemid() {
        return memid;
    }

    public void setMemid(Integer memid) {
        this.memid = memid;
    }

    public Byte getLevel() {
        return level;
    }

    public void setLevel(Byte level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo == null ? null : photo.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Byte getSex() {
        return sex;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    public Byte getWorkingage() {
        return workingage;
    }

    public void setWorkingage(Byte workingage) {
        this.workingage = workingage;
    }

    public String getCurrtitle() {
        return currtitle;
    }

    public void setCurrtitle(String currtitle) {
        this.currtitle = currtitle == null ? null : currtitle.trim();
    }

    public Byte getWorkingstate() {
        return workingstate;
    }

    public void setWorkingstate(Byte workingstate) {
        this.workingstate = workingstate;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label == null ? null : label.trim();
    }

    @JsonFormat(pattern = "M月d日")
    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    @JsonFormat(pattern = "M月d日")
    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
}